import data.Dictionary
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import java.io.File

fun main() {
    val list = File("converter/out").listFiles()!!.flatMap { Json.decodeFromString<List<Dictionary>>(it.readText()) }

    File("utools-plugin/data.json").absoluteFile.apply {
        if (exists()) {
            delete()
        }
        parentFile.mkdirs()
        createNewFile()
    }.writeText(Json.encodeToString(list))
}